package com.endoc.designpattern.chain;

/**
 * 新用户优惠
 */
public class NewsDiscount extends AbstractChainDiscount{

    public NewsDiscount(AbstractChainDiscount nextAbstractChainDiscount) {
        super(nextAbstractChainDiscount);
    }

    @Override
    public int calculate(int money) {
        if(money>100){
            System.out.println("新用户满100减20");
            money-=20;
        }
        return super.calculate(money);
    }
}
